package com.plugin.storage.storage.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

public class UploadVideo {

    private static final Logger LOGGER = LoggerFactory.getLogger(UploadVideo.class);

    private String videoId;

    private String playAuth;

    private Map<String, PlayInfo> playInfo;

    private VideoMeta videoMeta;

    public String getVideoId() {
        return videoId;
    }

    public UploadVideo setVideoId(String videoId) {
        this.videoId = videoId;
        return this;
    }

    public String getPlayAuth() {
        return playAuth;
    }

    public UploadVideo setPlayAuth(String playAuth) {
        this.playAuth = playAuth;
        return this;
    }

    public Map<String, PlayInfo> getPlayInfo() {
        return playInfo;
    }

    public UploadVideo setPlayInfo(Map<String, PlayInfo> playInfo) {
        this.playInfo = playInfo;
        return this;
    }

    public VideoMeta getVideoMeta() {
        return videoMeta;
    }

    public UploadVideo setVideoMeta(VideoMeta videoMeta) {
        this.videoMeta = videoMeta;
        return this;
    }

    @Override
    public String toString() {
        return "UploadVideo{" +
                "videoId='" + videoId + '\'' +
                ", playAuth='" + playAuth + '\'' +
                ", playInfo=" + playInfo +
                ", videoMeta=" + videoMeta +
                '}';
    }

    public static class Auth {

        private String uploadAuth;

        private String uploadAddress;

        private String videoId;

        public String getUploadAuth() {
            return uploadAuth;
        }

        public Auth setUploadAuth(String uploadAuth) {
            this.uploadAuth = uploadAuth;
            return this;
        }

        public String getUploadAddress() {
            return uploadAddress;
        }

        public Auth setUploadAddress(String uploadAddress) {
            this.uploadAddress = uploadAddress;
            return this;
        }

        public String getVideoId() {
            return videoId;
        }

        public Auth setVideoId(String videoId) {
            this.videoId = videoId;
            return this;
        }

        @Override
        public String toString() {
            return "Auth{" +
                    "uploadAuth='" + uploadAuth + '\'' +
                    ", uploadAddress='" + uploadAddress + '\'' +
                    ", videoId='" + videoId + '\'' +
                    '}';
        }
    }

    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class VideoMeta {
        private String coverURL;

        private String duration;

        private String status;

        private String title;

        private String videoId;

        private String mediaType;

        private String creationTime;

        public String getCoverURL() {
            return coverURL;
        }

        public VideoMeta setCoverURL(String coverURL) {
            this.coverURL = coverURL;
            return this;
        }

        public String getDuration() {
            return duration;
        }

        public VideoMeta setDuration(String duration) {
            this.duration = duration;
            return this;
        }


        public String getStatus() {
            return status;
        }

        public VideoMeta setStatus(String status) {
            this.status = status;
            return this;
        }

        public String getTitle() {
            return title;
        }

        public VideoMeta setTitle(String title) {
            this.title = title;
            return this;
        }

        public String getVideoId() {
            return videoId;
        }

        public VideoMeta setVideoId(String videoId) {
            this.videoId = videoId;
            return this;
        }

        public String getMediaType() {
            return mediaType;
        }

        public VideoMeta setMediaType(String mediaType) {
            this.mediaType = mediaType;
            return this;
        }

        public String getCreationTime() {
            return creationTime;
        }

        public VideoMeta setCreationTime(String creationTime) {
            this.creationTime = creationTime;
            return this;
        }

        @Override
        public String toString() {
            return "VideoMeta{" +
                    "coverURL='" + coverURL + '\'' +
                    ", duration='" + duration + '\'' +
                    ", status='" + status + '\'' +
                    ", title='" + title + '\'' +
                    ", videoId='" + videoId + '\'' +
                    ", mediaType='" + mediaType + '\'' +
                    ", creationTime='" + creationTime + '\'' +
                    '}';
        }
    }

    public static class PlayInfo {

        private Long width;

        private Long height;

        private Long size;

        private String playURL;

        private String bitrate;

        private String definition;

        private String duration;

        private String format;

        private String fps;

        private Long encrypt;

        private String plaintext;

        private String complexity;

        private String streamType;

        private String rand;

        private String jobId;

        public Long getWidth() {
            return width;
        }

        public PlayInfo setWidth(Long width) {
            this.width = width;
            return this;
        }

        public Long getHeight() {
            return height;
        }

        public PlayInfo setHeight(Long height) {
            this.height = height;
            return this;
        }

        public Long getSize() {
            return size;
        }

        public PlayInfo setSize(Long size) {
            this.size = size;
            return this;
        }

        public String getPlayURL() {
            return playURL;
        }

        public PlayInfo setPlayURL(String playURL) {
            this.playURL = playURL;
            return this;
        }

        public String getBitrate() {
            return bitrate;
        }

        public PlayInfo setBitrate(String bitrate) {
            this.bitrate = bitrate;
            return this;
        }

        public String getDefinition() {
            return definition;
        }

        public PlayInfo setDefinition(String definition) {
            this.definition = definition;
            return this;
        }

        public String getDuration() {
            return duration;
        }

        public PlayInfo setDuration(String duration) {
            this.duration = duration;
            return this;
        }

        public String getFormat() {
            return format;
        }

        public PlayInfo setFormat(String format) {
            this.format = format;
            return this;
        }

        public String getFps() {
            return fps;
        }

        public PlayInfo setFps(String fps) {
            this.fps = fps;
            return this;
        }

        public Long getEncrypt() {
            return encrypt;
        }

        public PlayInfo setEncrypt(Long encrypt) {
            this.encrypt = encrypt;
            return this;
        }

        public String getPlaintext() {
            return plaintext;
        }

        public PlayInfo setPlaintext(String plaintext) {
            this.plaintext = plaintext;
            return this;
        }

        public String getComplexity() {
            return complexity;
        }

        public PlayInfo setComplexity(String complexity) {
            this.complexity = complexity;
            return this;
        }

        public String getStreamType() {
            return streamType;
        }

        public PlayInfo setStreamType(String streamType) {
            this.streamType = streamType;
            return this;
        }

        public String getRand() {
            return rand;
        }

        public PlayInfo setRand(String rand) {
            this.rand = rand;
            return this;
        }

        public String getJobId() {
            return jobId;
        }

        public PlayInfo setJobId(String jobId) {
            this.jobId = jobId;
            return this;
        }

        @Override
        public String toString() {
            return "PlayInfo{" +
                    "width=" + width +
                    ", height=" + height +
                    ", size=" + size +
                    ", playURL='" + playURL + '\'' +
                    ", bitrate='" + bitrate + '\'' +
                    ", definition='" + definition + '\'' +
                    ", duration='" + duration + '\'' +
                    ", format='" + format + '\'' +
                    ", fps='" + fps + '\'' +
                    ", encrypt=" + encrypt +
                    ", plaintext='" + plaintext + '\'' +
                    ", complexity='" + complexity + '\'' +
                    ", streamType='" + streamType + '\'' +
                    ", rand='" + rand + '\'' +
                    ", jobId='" + jobId + '\'' +
                    '}';
        }
    }
}
